package com.eig.courseweb.controller;

import com.eig.common.vo.Result;
import com.eig.courseweb.service.impl.ShouCangTeacherServiceImpl;
import com.eig.courseweb.vo.ShouCangVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.annotation.Resource;

/**
 * @author ：StudentLsj（李世界）
 * @date ：Created in 2023/01/06 下午 02:08
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("core/shoucangTeacher")
@Api(tags = "我的关注")
@EnableSwagger2
public class ShouCangTeacherController {

    @Resource
    private ShouCangTeacherServiceImpl shouCangTeacherService;

    @PostMapping("/findAttentionTeacherById/{HuiYuanId}")
    @ApiOperation(value = "讲师查询")
    public Result findAttentionTeacherById(@PathVariable String HuiYuanId) {
        return shouCangTeacherService.findAttentionTeacherById(HuiYuanId);
    }
    @PostMapping("/deleteAttentionTeacher")
    @ApiOperation(value = "取消讲师收藏")
    public Result deleteAttentionTeacher(@RequestBody ShouCangVo s) {
        return shouCangTeacherService.deleteFavoriteCourse(s);
    }
    @PostMapping("/addAttentionTeacher")
    @ApiOperation(value = "讲师收藏")
    public Result addAttentionTeacher(@RequestBody ShouCangVo s) {
        return shouCangTeacherService.addAttentionTeacher(s);
    }
    @PostMapping("/findAttentionTeacher")
    @ApiOperation(value = "进入页面渲染是否已经关注讲师收藏")
    public Result findAttentionTeacher(@RequestBody ShouCangVo s) {
        return shouCangTeacherService.findAttentionTeacher(s);
    }
}
